Please use the sample project file to understand how the functions work.
This document only provides a quick reference to the function names.
a) Parsing functions
GetXMLTag (in as String, name as String)
GetXMLTag (in as String, name as String, byRef pos as Integer)
GetXMLTag (in as String, name as String, default as String)
returns the first occurence of the tag "name" inside the "in" string.
- "pos" defines an optional start position (which will afterwards
point to the end of the tag)
- "default" will be returned if the tag could not be found.
GetXMLTagRegion (in as String, name as String)
GetXMLTagRegion (in as String, name as String, default as String)
GetXMLTagRegion (in as String, name as String, incl as Boolean)
GetXMLTagRegion (in as String, name as String, ByRef pos as Integer)
GetXMLTagRegion (in as String, name as String, ByRef pos as Integer, incl as Boolean)
returns the contents of the tag region "name" in the "in" string.
- "pos" defines an optional start position (which will afterwards
point to the end of the tag)
- "default" will be returned if the tag could not be found.
- if "incl" is true, the starting and closing tags will be included
GetXMLTagParamStr (in as String, name as String, dflt as String)
returns a named parameter from a tag. You need to extract the tag first
(using "GetXMLTag") and pass it as the "in" string!
- "dflt" will be returned if the parameter could not be found.
b) Helpers
XMLEncode (in as String)
ISO-encodes the passed string. Note: This only works correctly with ISO-Latin1 (western) texts, though it should work sufficiently with other encodings.
XMLDecode (in as String)
decodes ISO-entities. Note: This only works correctly with ISO-Latin1 (western) encodings!
XMLStr2Color (in as String, default as Color)
converts a color string to a RB color object.
b) Internal
GetXMLTagPos (in as String, name as String)
GetXMLTagPos (in as String, name as String, start as Integer)
returns the position (as Integer) of the first occurence of the named tag
in the "in" string.
- "start" defines a start position for the search (default=0)
GetXMLTagLen (in as String, start as Integer)
returns the length of the tag starting at position "start" in the "in" string.
b) Generator
MakeXMLTag (name as String)
MakeXMLTag (name as String, para1 as String, val1 as String [..])
generates a tag with the passed name. Up to three parameters can be passed as name/value pairs.
MakeXMLTagRegion (name as String, content as String)
MakeXMLTagRegion (name as String, content as String, para1 as String, val1 as String [..])
generates a tag region (with closing tags) enclosing the "content" string. The parameters are the same as in the "MakeXMLTag" function
MakeXMLTagRegion (name as String, content as String)
MakeXMLTagRegion (name as String, content as String, para1 as String, val1 as String [..])
generates an empty tag (with no content) similar to "MakeXMLTagRegion". The main difference is that you can choose to generate short empty tags as defined by XML 1.0 and XHTML 1.0 by changing the "kXMLUseShortEmptyTags" constant to "true" - although this is not recommended!
MakeXMLEndTag (name as String)
generates a simple ending tag with the passed name.